/*****************************************************************************
 * Copyright (c) 2010 -, Anders All rights reserved
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  Contact: Anders Uddenberg (anders.uddenberg@gmail.com)
 * 
 *
 ****************************************************************************/
package org.easypr.organizer.server;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;


// TODO: Auto-generated Javadoc
/**
 * The Class JDOContact.
 */
@PersistenceCapable
public class JDOContact {

	/** The key. */
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
	
    /** The name. */
    @Persistent
    private String name;
    
    /** The first letter. */
    @Persistent
    private String firstLetter;
    
    /** The email. */
    @Persistent
	private String email;
    
    /** The cellphone. */
    @Persistent
	private String cellphone;
    
    /** The workphone. */
    @Persistent
	private String workphone;
    
    /** The workplace. */
    @Persistent
	private String workplace;
    
    /** The background. */
    @Persistent
	private String background;
    
    /** The belong to. */
    @Persistent
    private String belongTo; // Email adress
	
	
	/**
	 * Instantiates a new jDO contact.
	 *
	 * @param key the key
	 * @param belongTo the belong to
	 * @param name the name
	 * @param email the email
	 * @param cellphone the cellphone
	 * @param workphone the workphone
	 * @param workplace the workplace
	 * @param backround the backround
	 */
	public JDOContact(Key key, String belongTo, String name, String email, String cellphone,
			String workphone, String workplace, String backround) {
		this.key = key;
		this.belongTo = belongTo;
		this.name = name;
		this.firstLetter = name.substring(0, 1).toLowerCase();
		this.email = email;
		this.cellphone = cellphone;
		this.workphone = workphone;
		this.workplace = workplace;
		this.background = backround;
	}
	
	/**
	 * Gets the owner.
	 *
	 * @return the owner
	 */
	public String getOwner() {
		return this.belongTo;
	}
	
	/**
	 * Gets the key.
	 *
	 * @return the key
	 */
	public Key getKey() {
		return this.key;
	}
	
	/**
	 * Gets the name.
	 *
	 * @return the name
	 */
	public String getName() {
		return this.name;
	}
	
	/**
	 * Gets the first letter.
	 *
	 * @return the first letter
	 */
	public String getFirstLetter() {
		return this.firstLetter;
	}
	
	/**
	 * Gets the email.
	 *
	 * @return the email
	 */
	public String getEmail() {
		return this.email;
	}
	
	/**
	 * Gets the cellphone.
	 *
	 * @return the cellphone
	 */
	public String getCellphone() {
		return this.cellphone;
	}
	
	/**
	 * Gets the workphone.
	 *
	 * @return the workphone
	 */
	public String getWorkphone() {
		return this.workphone;
	}
	
	/**
	 * Gets the workplace.
	 *
	 * @return the workplace
	 */
	public String getWorkplace() {
		return this.workplace;
	}
	
	/**
	 * Gets the background.
	 *
	 * @return the background
	 */
	public String getBackground() {
		return this.background;
	}
}
